const {Gpio} = require("onoff");


const list = ['21', '20', '16', '26'];
let count = 0;


setInterval(()=>{
    list.forEach((item, index)=>{
        let le = new Gpio(item, 'out');
        if(count === index) {
            le.writeSync(1);
        }else {
            le.writeSync(0);
        }
    })
    count+=1;
    if(count >= 4) {
        count = 0
    }
    console.log(count);
}, 1000)